<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "mall_bill".
 *
 * @property int $id
 * @property int $uid 用户标识
 * @property int $sid 购买商品或者产生佣金的用户id
 * @property int $mid 商家用户id
 * @property int $direct 1直属上级2间接上级3商店收入
 * @property string $direct_text direct转文字
 * @property string $out_trade_no 订单号
 * @property string $amount 分的金额
 * @property int $create_time 创建时间
 * @property int $status 状态是否有用默认1有用 不等于1或者-1作废    1 已结算 2未结算
 * @property int $mall_model 使用的佣金分配模式
 * @property string $score 用户增加积分之前的分数
 * @property int $star 星数
 * @property string $star_name 星数名
 * @property int $finish_time 完成时间
 */
class MallBill extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'mall_bill';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['uid', 'mid', 'direct', 'out_trade_no', 'amount', 'create_time'], 'required'],
            [['uid', 'sid', 'mid', 'direct', 'create_time', 'status', 'mall_model', 'star', 'finish_time'], 'integer'],
            [['amount', 'score'], 'number'],
            [['direct_text'], 'string', 'max' => 100],
            [['out_trade_no'], 'string', 'max' => 50],
            [['star_name'], 'string', 'max' => 20],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'uid' => 'Uid',
            'sid' => 'Sid',
            'mid' => 'Mid',
            'direct' => 'Direct',
            'direct_text' => 'Direct Text',
            'out_trade_no' => 'Out Trade No',
            'amount' => 'Amount',
            'create_time' => 'Create Time',
            'status' => 'Status',
            'mall_model' => 'Mall Model',
            'score' => 'Score',
            'star' => 'Star',
            'star_name' => 'Star Name',
            'finish_time' => 'Finish Time',
        ];
    }
}
